export function isBefore(startDate, endDate) {
  const start = new Date(startDate).getTime()
  const end = endDate ? new Date(endDate).getTime() : new Date().getTime()
  if (start < end || start === end) {
    return true
  }
  return false
}

export function diffDay(startDate, endDate) {
  const start = new Date(startDate).getTime()
  const end = endDate ? new Date(endDate).getTime() : new Date().getTime()
  const diff = Math.floor((end - start) / (1000 * 60 * 60 * 24))
  return diff
}